const http = require('http');

//创建服务器实例
let server = http.createServer();

//监听请求
server.on('request', (req, res) => {
    // console.log(req.url);
    // res.end('<h1>Hello, World!</h1>');
    if (req.url == '/') {
        res.end('<h1>index</h1>')
    } else if (req.url == '/login') {
        res.end('<h1>login</h1>')
    } else {
        res.end('<h1>404 not found</h1>')
    }
})

//绑定监听端口 默认80端口
server.listen(10000, () => {
    console.log('server is running......');

})